Skip to content

perf: defer scipy.stats import in PriorVectorized#1186

Merged
Jammy2211 merged 1 commit intomain_buildfrom
feature/lazy-imports
Apr 7, 2026
Merged

perf: defer scipy.stats import in PriorVectorized#1186
Jammy2211 merged 1 commit intomain_buildfrom
feature/lazy-imports

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Move scipy.stats.norm from module-level import to local imports inside PriorVectorized.__init__ and __call__ methods. This avoids loading scipy during import autofit, reducing the import floor for downstream packages.

Part of PyAutoLabs/PyAutoLens#426.

API Changes

None — internal changes only.

Test Plan

  • pytest test_autofit/ -x — 1198 passed
  • Smoke tests via downstream /smoke-test
Full API Changes (for automation & release notes)

No public API changes. Single internal import reorganization:

  • autofit/mapper/prior/vectorized.pyfrom scipy.stats import norm moved from module level to local imports in PriorVectorized.__init__ and PriorVectorized.__call__

🤖 Generated with Claude Code

Move scipy.stats.norm from module-level import to local imports inside
PriorVectorized methods. This avoids loading scipy during
`import autofit`, reducing the import floor by ~0.1s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 1153dce into main_build Apr 7, 2026
1 check passed
@Jammy2211 Jammy2211 deleted the feature/lazy-imports branch April 7, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant